package com.azxc.rapid.auth.config;

import com.fujieid.jap.core.config.JapConfig;
import com.fujieid.jap.sso.config.JapSsoConfig;

/**
 * @ClassName : com.azxc.rapid.auth.config.JapConfigContext
 * @Description : 公共配置
 * @Author : linym
 * Created by user on 2022-02-15 17:18:09
 */
public class JapConfigContext {
	public static boolean sso = false;
	public static String strategy = "";
	public static String cookieDomain="jap.com";
	public static JapConfig getConfig() {
		return new JapConfig()
			.setSso(sso)
			.setSsoConfig(new JapSsoConfig()
				/*
					将 domain 设置为 .jap.com 报错：
					java.lang.IllegalArgumentException: An invalid domain [.jap.com] was specified for this cookie
					参考解决方案：
					https://gitee.com/baomidou/kisso/wikis/java.lang.IllegalArgumentException:-An-invalid-domain-%5B.x.com%5D-was-specified-for-this-cookie?sort_id=12454
					高版本 8.5版本 + tomcat 对 cookie 处理机制变更，原来设置 .x.com 应该修改为 x.com
				 */
				//.setCookieDomain("jap.com"));
				.setCookieDomain(cookieDomain));
	}
}
